package com.train.streamsend.rabbitsend;

import com.train.streamsend.sources.Source2;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.MessageBuilder;

import javax.annotation.Resource;

@EnableBinding(Source2.class)
public class SendMessage2Impl implements SendMessage{
    @Resource(name = "output_2")
    private MessageChannel output;
    @Override
    public String send(String message) {
        output.send(MessageBuilder.withPayload(message).build());
        return message;
    }
}
